<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>6-利用arguments对象求任意个数的最大值</title>
	</head>
	<body>
		<script type="text/javascript">
			function getMax(){
				console.log(arguments);
				console.log(arguments.length);
				//假定实参1是最大值
				var max = arguments[0];
				console.log(max);
				for(var i=0;i<arguments.length;i++){
					if(arguments[i]>max){
						max = arguments[i];
					}
				}
				return max;
			}
			
			var x = getMax(1,9,95);
			var y = getMax(1,9,95,100,1000);
			console.log(y);
		</script>
	</body>
</html>
